/**.
 *
 */
package com.ww.companyCabinetSystem.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.ww.companyCabinetSystem.dao.IAdminDao;
import com.ww.companyCabinetSystem.model.bo.MAdminBo;
import com.ww.companyCabinetSystem.utils.BeanUtils;
import com.ww.keyIdAutomaticGeneration.factory.KeyIdGenerationFactory;

/**.
 * com.ww.companyCabinetSystem.dao.impl
 * TODO
 * @author veloster
 * 下午10:19:13
 */
@Component("adminDao")
public class AdminDaoImpl extends BaseDaoImpl implements IAdminDao {
	
	@Override
	public boolean insertAdmin(MAdminBo bo){
		String keyId = KeyIdGenerationFactory.createKeyId();
		bo.setKeyId(keyId);
		BeanUtils.notNull(bo);
		return this.sqlSession.insert("com.ww.companyCabinetSystem.dao.IAdminDao.insertAdmin", bo)>0;
	}

	@Override
	public boolean updateAdmin(MAdminBo bo) {
		return this.sqlSession.update("com.ww.companyCabinetSystem.dao.IAdminDao.updateAdmin", bo)>0;
	}

	@Override
	public List<MAdminBo> selectByConfitions(MAdminBo bo) {
		return this.sqlSession.selectList("com.ww.companyCabinetSystem.dao.IAdminDao.selectByConfitions", bo);
	}
	
}
